﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Bxas.Core;
using Bxas.Core.Exceptions;
using DigitalAmele.BLL.Authantication;
using DigitalAmele.BLL.Adapters;

namespace DigitalAmele.BLL.Core
{
    public class BaseBs : CoreBs
    {

        public BaseBs()
        {
            //connectionManagecr = new ConnectionManager(Properties.Settings.Default.conString);
        }


        public BxasCoreException ErrorLogInsert(Exception ex)
        {
            try
            {
                ProjectErrorBs projectErrorBs = new ProjectErrorBs();
                ProjectErrors projectErrors = new ProjectErrors();
                projectErrors.Cls = "aaa";
                projectErrors.ErrorCode = ex.GetHashCode().ToString();
                projectErrors.ErrorDate = DateTime.Now;
                projectErrors.Func = "bbb";
                projectErrors.Id = Guid.NewGuid();
                projectErrors.Message = ex.Message;                
                projectErrorBs.insert(projectErrors);
                return new BxasCoreException(ExceptionFormatter.ResolveException(ex), ex);
            }
            catch (Exception exx)
            {
                return new BxasCoreException(ExceptionFormatter.ResolveException(exx), exx);
            }

        }


    }
}
